import NotificationComponent from './Notification.vue'
import Vue from 'vue'

function Notification(option) {
  Notification.init(option)
}

Notification.init = (option) => {
  const Message = Vue.extend(NotificationComponent)
  const NotificationExtend = new Message({
    el: document.createElement('div')
  })

  NotificationExtend.showNotification(option)
  document.body.appendChild(NotificationExtend.$el)
}

export default {
  install(Vue) {
    Vue.prototype.$notify = Notification
  }
}
